using System;
using Office = Microsoft.Office.Core;
using System.Diagnostics;
using System.Reflection;

namespace bOSdotNET.Microsoft.Office
{
	/// <summary>
	/// Summary description for AccessHelper.
	/// </summary>
	public class AccessHelper
	{
		public AccessHelper()
		{
			
		}

		static public void RunMacro(string sDB, Object[] oRunArgs)
		{
			Access.ApplicationClass oAccess = new Access.ApplicationClass();
			oAccess.Visible = false;
			oAccess.OpenCurrentDatabase(sDB, false, "");

			OfficeHelper.RunMacro(oAccess, oRunArgs);

			oAccess.DoCmd.Quit(Access.AcQuitOption.acQuitSaveNone);
			System.Runtime.InteropServices.Marshal.ReleaseComObject (oAccess);
			oAccess = null;
		}
	}
}
